package com.its.us.sk.server.tcp.handler;

import com.its.us.sk.server.tcp.base.BaseTcpServerHandler;
import com.its.us.sk.server.tcp.utils.ReceiveUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;


/**
 * @Author: master
 * @Date: 2020/11/24 8:59
 * @Version: 1.0
 */
public class InitQZServerHandler extends BaseTcpServerHandler {
    public InitQZServerHandler() {
    }



    /**
     * 处理钎子的初始化数据
     *
     * @param ch
     * @param buffer
     */
    @Override
    protected void channelRead(ChannelHandlerContext ch, ByteBuf buffer) {
        //System.out.println("消息：" + buffer);
        String msg = ReceiveUtil.getToString(buffer);
        System.err.println("msg:" + msg);
        // todo:初始化钎子入库方法
        // dosth

        // 推送给web
        // ReceiveUtil.pushAll(msg);
        ReceiveUtil.pushToOne("li4",msg);
    }


}
